<?php

namespace App\Models;


use Illuminate\Database\Eloquent\Model;

class Resume extends Model
{
	
    protected $table = 'resume';

    protected $hidden = [
        'created_at','updated_at',
    ];
    public function getEducationAttribute($value)
    {
        return config('setting.education')[$value];
    }

    public function getExpressAttribute($value)
    {
        return config('setting.express')[$value];
    }

    public function getWorkTypeAttribute($value)
    {
        return config('setting.work_type')[$value];
    }

    public function getUserStatusAttribute($value)
    {
        return config('setting.user_status')[$value];
    }

    public function getWorkAreaAttribute($value)
    {
        return ChinaAreaModel::getName($value);
    }

    public function getSalaryAttribute($value)
    {
        return config('setting.salary')[$value];
    }
    public function getList(){
        $field = ['user_name','img','age','education','lposition','work_area','id'];
        return self::query()->get($field);
    }

    public function getDetail($id){
        return self::query()->where('id',$id)->first();
    }

    public function getDetailByUserId($id){
        return self::query()->where('user_id',$id)->first();
    }

}
